server {
  listen 80;
  index index.html;

  location /api/ {
    proxy_set_header Host $http_host;
    proxy_pass http://backend:8000/api/;
  }
  location /admin/ {
    proxy_set_header Host $http_host;
    proxy_pass http://backend:8000/admin/;
  }
  location /static/admin/ {
    alias /collected_static/admin/;
  }
  location /static/rest_framework/ {
    alias /collected_static/rest_framework/;
  }
  location /api/docs/ {
    alias /api/docs/;
    try_files $uri $uri/ /redoc.html;
  }
  location /media/ {
    proxy_set_header Host $http_host;
    alias /media/;
  }
  location / {
    alias /staticfiles/;
    try_files $uri $uri/ /index.html;
  }
}